package 并查集;

public class QuickUnionRankPH extends QuickUnionRank{

	public QuickUnionRankPH(int capacity) {
		super(capacity);
	}
	
	/**
	 * 路径分裂
	 */
	@Override
	public int find(int v) {
		rangeCheck(v);
		while (v != parents[v]) {
			parents[v] = parents[parents[v]];
			v = parents[v];
		}
		return v;
	}
	
}
